<?php
namespace Badmins\Model;
use Think\Model;
class TicketModel extends Model{
	protected $_validate = array(
	    array('name','require','优惠券名称必须'),
		array('name','','优惠券名称已存在',0,'unique',1),
		array('value','number','请输入优惠券的面值'),
		array('num','number','请输入优惠券的发放数量'),
		array('start_time','require','开始时间必须'),
		array('end_time','require','结束时间必须'),
		array('start_time,end_time','cktime','结束时间必须大于开始时间',1,'callback',3),
	);
	public function cktime($data){
		if($data['end_time']<$data['start_time']){
			return false;
		}else{
			return true;
		}
	}
}